import request from '@/utils/request'

// 工单导出
export function carWorkOrderExport(data) {
  return request({
    url: '/car/carWorkOrder/export',
    method: 'post',
    data: data
  })
}
// 工单详情
export function getWorkOrder(id) {
  return request({
    url: '/car/carWorkOrder/'+id,
    method: 'get',

  })
}
// 新建工单
export function addCarWorkOrder(data) {
  return request({
    url: '/car/carWorkOrder',
    method: 'post',
    data: data
  })
}


// 列表
export function getDataList(query) {
  return request({
    url: '/car/carWorkOrder/list',
    method: 'get',
    params: query
  })
}

// 列表
export function getInsuranceWorkList(query) {
  return request({
    url: '/car/carWorkOrder/getInsuranceWorkList',
    method: 'get',
    params: query
  })
}

//
export function getIdAndName(query) {
  return request({
    url: '/system/region/getIdAndName',
    method: 'get',
    params: query
  })
}

// 校验统一合同号
export function unifyCheck(data) {
  return request({
    url: '/car/carWorkOrder/check',
    method: 'post',
    data: data
  })
}


// {carId} 车辆基础信息
export function carBasic(id) {
  return request({
    url: '/car/carBasic/' + id,
    method: 'get',

  })
}

// 省市大区
export function treeByArea(query) {
  return request({
    url: '/system/region/treeByArea',
    method: 'get',
    params: query
  })
}

export function batchData(data) {
  return request({
    url: '/car/insurance/findBasicByIds',
    method: 'post',
    data: data
  })
}

//批量处理
export function addBatchList(data) {
  return request({
    url: '/car/insurance/addBatchList',
    method: 'post',
    data: data
  })
}


//计算年检时间的
export function calculateLastInspectionDate(data) {
  return request({
    url: '/car/carInspection/calculateLastInspectionDate',
    method: 'post',
    data: data
  })
}
